alter table Contact
add PartnerFirstName varchar(100) null,
	PartnerLastName varchar(100) null,
	DateOfBirth datetime null
go
insert into ContactColumn
(ContactColumnName, ContactColumnFriendlyName)	
select 'PartnerFirstName', 'Partner/Spouse First Name'
union
select 'PartnerLastName', 'Partner/Spouse Last Name'
union
select 'DateOfBirth', 'Date of Birth'
go
ALTER FUNCTION [dbo].[fnContactColumnValue]
(
  @ContactId INT,
  @ColumnName VARCHAR(255)
)
RETURNS VARCHAR(1000)
AS  
BEGIN
RETURN(select case when @ColumnName = 'FirstName' then Contact.FirstName
                     when @ColumnName = 'LastName' then Contact.LastName
                     when @ColumnName = 'Address1' then Contact.Address1
                     when @ColumnName = 'Address2' then Contact.Address2
                     when @ColumnName = 'City' then Contact.City
                     when @ColumnName = 'State' then [State].StateCode
                     when @ColumnName = 'Zip' then Contact.Zip
                     when @ColumnName = 'Email' then Contact.Email
                     when @ColumnName = 'MPhone' then Contact.MPhone
                     when @ColumnName = 'WPhone' then Contact.WPhone
                     when @ColumnName = 'HPhone' then Contact.HPhone
                     when @ColumnName = 'CompanyName' then Contact.CompanyName
                     when @ColumnName = 'JobTitle' then Contact.JobTitle
                     when @ColumnName = 'PartnerFirstName' then Contact.PartnerFirstName
                     when @ColumnName = 'PartnerLastName' then Contact.PartnerLastName
                     when @ColumnName = 'DateOfBirth' then convert(varchar(10), Contact.DateOfBirth, 101)
                END AS ColumnValue
         FROM Contact (nolock) left join [State] (nolock) on Contact.StateId = [State].StateId
         WHERE Contact.ContactId = @ContactId)
END
go